﻿<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <div>
        <div id="header" style="display:none">

        </div>
        <div style="overflow-y:scroll;height:400px;width:600px;padding:8px" ng-transclude id="body">

        </div>
    </div>
    <script>
        $tmp.$s.$watch(function () {
            return $($($tmp.$e[0]).find("#body")[0]).children().length;
        }, function (n, o) {
            if (angular.isUndefined(n)) return;
            if (n != o) {
                var w = $($($tmp.$e[0]).find("#body")[0]).width();
                $($($tmp.$e[0]).find("#body")[0]).children().each(function (index, ele) {
                    $(ele).css("min-width", w - 20);
                    $(ele).css("max-width", w - 20);
                });
            }
        });
       
        $tmp.$a.$observe("header", function (v) {
            if (angular.isUndefined(v)) return;
            $($tmp.$e[0]).find(v).appendTo($($tmp.$e[0]).children()[0]);
            $($($tmp.$e[0]).children()[0]).show();
        });
    </script>
</body>
</html>